<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {

            $table->string('user_uuid',50)->primary();
            $table->string('user_account',50)->unique();
            $table->string('email',100)->unique();
            $table->string('main_cellphone',20)->unique();
            $table->string('password',80);
            $table->integer('role_code');
            $table->boolean('is_delete')->default(false);

            $table->index(['user_account','password']);

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}
